Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fields Metadata] Restrict access to integration fields by privileges #199774

Merged
merged 6 commits into from
Nov 19, 2024

Conversation

tonyghiani
Copy link
Contributor

@tonyghiani tonyghiani commented Nov 12, 2024

📓 Summary

Related to #198349

Disabling authorization on fields metadata find API implies every user would have access to the integration fields since we use the internal user to retrieve the package information.

On the other hand, requiring API root-level privileges for fleet and fleetv2 would restrict more use cases since other apps might rely on this service to consume field metadata from ECS only, with no need for integration permissions (Discover, etc.).

To keep the door open to all these use cases, we'll check the available user privileges on a per-request basis and allow integration fields only when they have access to fleet and integrations, without fully restricting the service.

Screen.Recording.2024-11-12.at.12.38.05.mov

@tonyghiani tonyghiani added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Team:obs-ux-logs Observability Logs User Experience Team labels Nov 12, 2024
@tonyghiani tonyghiani requested a review from a team as a code owner November 12, 2024 12:20
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fieldsMetadata 44 45 +1
Unknown metric groups

API count

id before after diff
fieldsMetadata 44 45 +1

History

Copy link
Contributor

@yngrdyn yngrdyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👨🏼‍🔬

@tonyghiani tonyghiani merged commit 45056f3 into elastic:main Nov 19, 2024
21 checks passed
@tonyghiani tonyghiani deleted the fields-metadata-privileges branch November 19, 2024 08:00
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11908618373

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 19, 2024
…elastic#199774)

## 📓 Summary

Related to elastic#198349

Disabling authorization on fields metadata `find API` implies every user
would have access to the integration fields since we use the internal
user to retrieve the package information.

On the other hand, requiring API root-level privileges for `fleet` and
`fleetv2` would restrict more use cases since other apps might rely on
this service to consume field metadata from ECS only, with no need for
integration permissions (Discover, etc.).

To keep the door open to all these use cases, we'll check the available
user privileges on a per-request basis and allow integration fields only
when they have access to fleet and integrations, without fully
restricting the service.

https://github.com/user-attachments/assets/49b9953a-f1e1-410a-8c7f-c38d87408fcc

---------

Co-authored-by: Marco Antonio Ghiani <[email protected]>
(cherry picked from commit 45056f3)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 19, 2024
…ileges (#199774) (#200676)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Fields Metadata] Restrict access to integration fields by privileges
(#199774)](#199774)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marco Antonio
Ghiani","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-19T08:00:22Z","message":"[Fields
Metadata] Restrict access to integration fields by privileges
(#199774)\n\n## 📓 Summary\r\n\r\nRelated to #198349 \r\n\r\nDisabling
authorization on fields metadata `find API` implies every user\r\nwould
have access to the integration fields since we use the internal\r\nuser
to retrieve the package information.\r\n\r\nOn the other hand, requiring
API root-level privileges for `fleet` and\r\n`fleetv2` would restrict
more use cases since other apps might rely on\r\nthis service to consume
field metadata from ECS only, with no need for\r\nintegration
permissions (Discover, etc.).\r\n\r\nTo keep the door open to all these
use cases, we'll check the available\r\nuser privileges on a per-request
basis and allow integration fields only\r\nwhen they have access to
fleet and integrations, without fully\r\nrestricting the
service.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/49b9953a-f1e1-410a-8c7f-c38d87408fcc\r\n\r\n---------\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<[email protected]>","sha":"45056f3abb268048e27ac297e4f9238ac86dba69","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-logs"],"title":"[Fields
Metadata] Restrict access to integration fields by
privileges","number":199774,"url":"https://github.com/elastic/kibana/pull/199774","mergeCommit":{"message":"[Fields
Metadata] Restrict access to integration fields by privileges
(#199774)\n\n## 📓 Summary\r\n\r\nRelated to #198349 \r\n\r\nDisabling
authorization on fields metadata `find API` implies every user\r\nwould
have access to the integration fields since we use the internal\r\nuser
to retrieve the package information.\r\n\r\nOn the other hand, requiring
API root-level privileges for `fleet` and\r\n`fleetv2` would restrict
more use cases since other apps might rely on\r\nthis service to consume
field metadata from ECS only, with no need for\r\nintegration
permissions (Discover, etc.).\r\n\r\nTo keep the door open to all these
use cases, we'll check the available\r\nuser privileges on a per-request
basis and allow integration fields only\r\nwhen they have access to
fleet and integrations, without fully\r\nrestricting the
service.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/49b9953a-f1e1-410a-8c7f-c38d87408fcc\r\n\r\n---------\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<[email protected]>","sha":"45056f3abb268048e27ac297e4f9238ac86dba69"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199774","number":199774,"mergeCommit":{"message":"[Fields
Metadata] Restrict access to integration fields by privileges
(#199774)\n\n## 📓 Summary\r\n\r\nRelated to #198349 \r\n\r\nDisabling
authorization on fields metadata `find API` implies every user\r\nwould
have access to the integration fields since we use the internal\r\nuser
to retrieve the package information.\r\n\r\nOn the other hand, requiring
API root-level privileges for `fleet` and\r\n`fleetv2` would restrict
more use cases since other apps might rely on\r\nthis service to consume
field metadata from ECS only, with no need for\r\nintegration
permissions (Discover, etc.).\r\n\r\nTo keep the door open to all these
use cases, we'll check the available\r\nuser privileges on a per-request
basis and allow integration fields only\r\nwhen they have access to
fleet and integrations, without fully\r\nrestricting the
service.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/49b9953a-f1e1-410a-8c7f-c38d87408fcc\r\n\r\n---------\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<[email protected]>","sha":"45056f3abb268048e27ac297e4f9238ac86dba69"}}]}]
BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…elastic#199774)

## 📓 Summary

Related to elastic#198349 

Disabling authorization on fields metadata `find API` implies every user
would have access to the integration fields since we use the internal
user to retrieve the package information.

On the other hand, requiring API root-level privileges for `fleet` and
`fleetv2` would restrict more use cases since other apps might rely on
this service to consume field metadata from ECS only, with no need for
integration permissions (Discover, etc.).

To keep the door open to all these use cases, we'll check the available
user privileges on a per-request basis and allow integration fields only
when they have access to fleet and integrations, without fully
restricting the service.


https://github.com/user-attachments/assets/49b9953a-f1e1-410a-8c7f-c38d87408fcc

---------

Co-authored-by: Marco Antonio Ghiani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-logs Observability Logs User Experience Team v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants